package com.xhs.service.impl;

import com.xhs.dto.request.GetUserParam;
import com.xhs.entity.SysUserEntity;
import com.xhs.message.ReturnResult;
import com.xhs.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @desc:
 * @projectName: spring-boot-redis
 * @author: xhs
 * @date: 2024-06-24 024 14:34
 * @version: JDK 1.8
 */
@Slf4j
@Service
public class TestServiceImpl implements TestService {

    @Resource
    private CacheServiceImpl cacheService;

    /**
     * 根据手机号查询用户信息
     *
     * @param param 入参
     * @return ReturnResult<Object>
     */
    @Override
    public ReturnResult<Object> getCacheUser(GetUserParam param) {
        SysUserEntity userEntity = cacheService.getUserEntity(param.getPhone());
        log.info("<-----getCacheUser------>");
        return ReturnResult.success().setData(userEntity);
    }
}
